import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutterappmydemo/base/base_stateless_widget.dart';

class AATestPage extends BaseTitleStatelessWidget {
  @override
  String setTitle() {
    return "标题";
  }

  int _counter = 0;

  @override
  Widget getBody(BuildContext context, StreamController streamController) {
    return Container(
      child: Column(
        children: <Widget>[
          RaisedButton(
            child: Text("点击"),
            onPressed: () {
              streamController.sink.add(++_counter);
            },
          ),

          StreamBuilder<int>(
            stream: streamController.stream,
            initialData: _counter,
            builder: (BuildContext context, AsyncSnapshot<int> snapshot) {
              return Text('12222=: ${snapshot.data} times');
            },
          ),


        ],
      ),
    );
  }
}
